import { createRouter, createWebHashHistory } from "vue-router";
export const router = createRouter({
	history: createWebHashHistory(), //hash模式
	routes: [
		{
			path: "/search",
			name: "Search",
			component: () => import("../views/search/index.vue"), //路由懒加载
		},
		{
			path: "/home",
			name: "Home",
			component: () => import("../views/home/index.vue"),
		},
		{
			path: "/login",
			name: "Login",
			component: () => import("../views/login/index.vue"),
		},
		{
			path: "/register",
			name: "Register",
			component: () => import("../views/register/index.vue"),
		},
		{
			path: "/:pathMatch(.*)*", //匹配除以上的地址之外的地址
			redirect: "/",
		},
	],
});
